package com.sensors;

import android.util.Log;

/**
 * Created by tjpu on 2016/10/20.
 */
public class IRD {
    static String thisLogTag = "Gyroscope";

    short[] origin = {0,0};
    double[] metricUnit = {0.0, 0.0, 0.0};
    public static double CONVERT_TO_METRIC = 1.0;

    public int notReceive = 0;
    public boolean isNotReceive = false;

    public void putOrigin(short[] ird) {
        origin[0] = ird[0];
        origin[1] = origin[1];

        convert();
    }

    void convert() {
        metricUnit[0] = origin[0] * CONVERT_TO_METRIC;
        metricUnit[1] = origin[1] * CONVERT_TO_METRIC;
    }

    public void checkReceive() {
        notReceive++;
        if (notReceive > 3 && !isNotReceive) {
            isNotReceive = true;
            Log.e(thisLogTag,"can't receive data");
        }
    }
}
